﻿je_nov_main = {
	icon = "gfx/interface/icons/event_icons/event_skull.dds"

	complete = {
		scope:journal_entry = {
			is_goal_complete = yes
		}
		custom_tooltip = {
			text = nov_andrei_yuriyevich_died
			ruler = {
				NOT = { has_variable = is_andrei_yuriyevich }
			}
		}
	}

	on_complete = {
		trigger_event = { id = dvg_nov.2 }
	}

	fail = {
		OR = {
			NOT = { has_law = law_type:law_presidential_republic }
			custom_tooltip = {
				text = nov_andrei_yuriyevich_died_fail
				ruler = {
					NOT = { has_variable = is_andrei_yuriyevich }
				}
				scope:journal_entry = {
					is_goal_complete = no
				}
			}
		}
	}

	on_fail = {
		if = {
			limit = {
				NOT = { has_law = law_type:law_presidential_republic }
			}
			trigger_event = { id = dvg_nov.4 }
		} 
		else = {
			trigger_event = { id = dvg_nov.3 }
		}
	}

	on_monthly_pulse = {
		effect = {
			if = {
				limit = {
					ruler = { has_variable = is_andrei_yuriyevich }
					year >= 1855
				}
				ruler = { kill_character = yes }
			}
			if = {
				limit = {
					ruler = { has_variable = is_andrei_yuriyevich }
					OR = {
						AND  = {
							year >= 1846
							scope:journal_entry = {
								is_goal_complete = yes
							}
						}
						AND = {
							year >= 1851
						}
					}
				}
				random_list = {
					11 = { }
					1 = {
						ruler = { kill_character = yes }
					}
				}
			}
		}
	}

	current_value = {
		value = var:nov_var
	}

	goal_add_value = {
		add = 3
	}

	progressbar = yes

	timeout = 7300

	weight = 10000
	should_be_pinned_by_default = yes
}

# Serfdom
je_nov_serfdom = {
	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	complete = {
		scope:journal_entry = {
			is_goal_complete = yes
		}
		has_law = law_type:law_serfdom
	}

	on_complete = {
		#set_variable = completed_nov_serfdom_je
		custom_tooltip = je_nov_advance
		change_variable = {
			name = nov_var
			add = 1
		}
	}

	on_monthly_pulse = {
		effect = {
			if = {
				change_variable = {
					name = nov_serfdom
					add = 1
				}
			}
		}
	}

	fail = {
		NOT = { has_law = law_type:law_serfdom }
	}

	current_value = {
		value = var:nov_serfdom
	}

	goal_add_value = {
		add = 180
	}

	invalid = {
		custom_tooltip = {
			text = finished_nov_tt
			has_variable = nov_complete
		}
	}

	inheritable = no
	progressbar = yes

	weight = 5000
}

je_nov_non_russians = {
	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	complete = {

		OR = {
			custom_tooltip = {
				text = nov_resolved_nonrussians
				has_variable = VYA_nonrussians_end
			}
			AND = {
				year >= 1846
				NOT = { has_law = law_type:law_national_supremacy }
			}
		}
	}

	on_complete = {
		#set_variable = completed_nov_non_russians_je
		custom_tooltip = je_nov_advance
		change_variable = {
			name = nov_var
			add = 1
		}
	}

	invalid = {
		custom_tooltip = {
			text = finished_nov_tt
			has_variable = nov_complete
		}
	}

	inheritable = no

	weight = 5000
}

# Bureaucractic Reform
je_nov_bureaucracy = {
	icon = "gfx/interface/icons/event_icons/event_scales.dds"

	complete = {
		NOR = { 
			has_law = law_type:law_hereditary_bureaucrats 
			has_law = law_type:law_land_based_taxation
			has_law = law_type:law_consumption_based_taxation
		}
		bureaucracy >= 0 
		approaching_bureaucracy_shortage = no
	}

	on_complete = {
		#set_variable = completed_nov_bureaucracy_je
		custom_tooltip = je_nov_advance
		change_variable = {
			name = nov_var
			add = 1
		}
		remove_modifier = outmoded_bureaucracy
	}

	invalid = {
		custom_tooltip = {
			text = finished_nov_tt
			has_variable = nov_complete
		}
	}

	inheritable = no

	weight = 5000
}

# Education Reform
je_nov_education = {
	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	complete = {
		any_scope_building = {
			is_building_type = building_university
			occupancy > 0.9
			level >= 3
		}
		scope:journal_entry = {
			is_goal_complete = yes
		}
		has_law = law_type:law_private_schools
	}

	on_complete = {
		#set_variable = completed_nov_education_je
		custom_tooltip = je_nov_advance
		change_variable = {
			name = nov_var
			add = 1
		}
	}

	current_value = {
		value = root.literacy_rate
	}

	goal_add_value = {
		value = root.literacy_rate
		add = 0.2
	}

	invalid = {
		custom_tooltip = {
			text = finished_nov_tt
			has_variable = nov_complete
		}
	}

	inheritable = no
	progressbar = yes
	
	weight = 5000
}

# Urbanize Novgorod Reform
je_nov_urban_center = {
	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	complete = {
		capital = {
			any_scope_building = {
				is_building_type = building_urban_center
				level >= 7
			}
		}
	}

	on_complete = {
		#set_variable = completed_nov_education_je
		custom_tooltip = je_nov_advance
		change_variable = {
			name = nov_var
			add = 1
		}
	}

	invalid = {
		custom_tooltip = {
			text = finished_nov_tt
			has_variable = nov_complete
		}
	}

	inheritable = no

	weight = 5000
}